//
//  SACustomerDetailCell.m
//  SAP
//
//  Created by 中矿科技有限公司 on 17/9/16.
//  Copyright © 2017年 中矿科技有限公司. All rights reserved.
//

#import "SACustomerDetailCell.h"

@implementation SACustomerDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle =UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setFromCustomerDetailModel:(SACustomerDetailModel *)model indexPath:(NSIndexPath *)indexPath{
    if (indexPath.section ==0) {
        if(indexPath.row == 0)self.detailContext.text =model.customerCode;
        if(indexPath.row ==1) self.detailContext.text=model.name;
        if(indexPath.row ==2)self.detailContext.text =model.address;
        if(indexPath.row ==3) self.detailContext.text =model.legalPerson;
        if(indexPath.row ==4) self.detailContext.text =model.principalAgent;
        if(indexPath.row ==5) self.detailContext.text =model.nowContractConut;
    }
    if (indexPath.section ==1) {
        if(indexPath.row == 0)self.detailContext.text =model.bank;
        if(indexPath.row ==1) self.detailContext.text=model.bankAccount;
        if(indexPath.row ==2)self.detailContext.text =model.taxRegNumber;
        if(indexPath.row ==3) self.detailContext.text =model.zipCode;

    }
    if (indexPath.section ==2) {
        if(indexPath.row == 0)self.detailContext.text =model.phone;
        if(indexPath.row ==1) self.detailContext.text=model.isKeynote.integerValue ==1? @"是":@"否" ;

    }
    
}

-(void)setFromUserProfileModelIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section ==0) {
        if(indexPath.row == 0)self.detailContext.text =[[UserManager sharedInstance] getUserName];
        if(indexPath.row ==1) self.detailContext.text=[[UserManager sharedInstance] getNickname];
    }
    if (indexPath.section ==1) {
        if(indexPath.row == 0)self.detailContext.text =[[UserManager sharedInstance] getMobile];
        
        if(indexPath.row ==1) self.detailContext.text = [[UserManager sharedInstance] getEmailAddress];

    }
    if (indexPath.section ==2) {
        if(indexPath.row == 0)self.detailContext.text =[[UserManager sharedInstance] getCompanyName];
        if(indexPath.row ==1) self.detailContext.text = [[UserManager sharedInstance] getOuName];
        if(indexPath.row ==2) self.detailContext.text = [[UserManager sharedInstance] getPositionTitle];

        
    }
    
}



@end
